package com.xmall.controller.admin;

import com.xmall.bean.vo.BaseRespVo;
import com.xmall.bean.bo.LogListBo;
import com.xmall.bean.table.Log;
import com.xmall.bean.vo.ListDataVo;
import com.xmall.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/log")
public class LogController {

    @Autowired
    LogService logService;

    @RequestMapping("list")
    public BaseRespVo queryLogList(LogListBo logListBo) {
        // 校验
        if (!logListBo.isValid()) {
            return BaseRespVo.fail("参数无效，请重新输入");
        }
        ListDataVo<Log> logListVo = logService.queryLogList(logListBo);
        return BaseRespVo.ok(logListVo);
    }
}
